<template>
<div>
    <div class="banner" @click="handleBannerClick">
        <img class="banner-img" 
        src="http://img1.qunarzz.com/sight/p0/1504/47/4730a0c01664b63d.water.jpg_r_800x800_cec96b20.jpg">
         <div class="banner-info">
            <div class="banner-title">{{this.sightName}}</div>
            <div class="banner-num">
                <span class="iconfont banner-icon">&#xe626;</span>
                <span class="number">{{this.bannerImgs.length}}</span> 
            </div>
        </div>
    </div>
     <fade-animation>
    <commonGallary 
    :imgs="bannerImgs"
    v-show="showGallary"
    @close="handleGallaryClose"
    ></commonGallary>
    </fade-animation>
</div>
</template>

<script>
import commonGallary from '../../common/gallary/gallary.vue'
import FadeAnimation from '../../common/fade/FadeAnimation.vue'
export default {
    name: 'banner',
    props:{
        sightName: String,
        bannerImg: String,
        bannerImgs: Array
    },
    methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  },
    data() {
        return {
            showGallary:false,
            
        }
    },
    components:{
        commonGallary,
        FadeAnimation
    }
}
</script>

<style lang="stylus" scoped>
.banner
    position relative
    overflow hidden
    height 0
    padding-bottom 55%
    .banner-img
        width 100%
    .banner-info
        display flex
        position absolute
        left 0
        right 0
        bottom 0
        line-height 2rem
        color #FFF
        background-image : linear-gradient(top,rgba(0,0,0,0),rgba(0,0,0,0.6))
    .banner-title
        flex 1
        color white
        padding-left .8rem
    .banner-num
        margin-right .4rem
        height 1.6rem
        width 4rem
        border-radius 1.6rem
        background rgba(0,0,0,0.8)
        font-size .26rem
        line-height 1.6rem
        color white
        text-align center
        .banner-icon
            padding-right .2rem
            line-height 1.7rem

           

    


</style>
